//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.xxxy.jsq.action.rule;

import com.alibaba.fastjson2.JSONObject;
import com.alibaba.fastjson2.JSONWriter;
import com.xxxy.jsq.dao.RuleDao;
import com.xxxy.jsq.model.Rule;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet({"/getRulesServlet"})
public class getRulesServlet extends HttpServlet {
    private static final long serialVersionUID = 1L;

    public getRulesServlet() {
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("utf-8");
        response.setCharacterEncoding("utf-8");
        response.setContentType("application/json;charset=utf-8");
        RuleDao dao = new RuleDao();
        List<Rule> list = dao.getAllky();
        JSONObject jo = new JSONObject();
        jo.put("data", list);
        PrintWriter out = response.getWriter();
        out.print(jo.toJSONString(new JSONWriter.Feature[0]));
        out.flush();
        out.close();
    }

    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doGet(request, response);
    }
}

